﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TuyennvLibrary.Reflection
{
    /// <summary>
    /// Lấy mã lỗi
    /// </summary>
    public class Code
    {


        public static int SUCCESS = 0;
        public static int NOT_PERMISSION = 1;
        public static int WARNING = 3;
        public static int ERROR = -1;
        public static int ERROR_CLASS = -100;
        public static int ERROR_METHOD = -200;
        public static int METHOD_NULL = -201;
        public static int ERROR_PARAMS = -300;
        public static object notPermisssion()
        {
            return new { code = NOT_PERMISSION, message = "not permission" };
        }

        public static object success()
        {
            return new { code = SUCCESS, message = "thành công" };
        }
        public static object error()
        {
            return new { code = ERROR, message = "lỗi khác" };
        }
        public static object errorParams()
        {
            return new { code = ERROR_PARAMS, message = "không đúng params" };
        }
        public static object errorClass()
        {
            return new { code = ERROR_CLASS, message = "không đúng class" };
        }
        public static object errorMethod()
        {
            return new { code = ERROR_METHOD, message = "không đúng method" };
        }
        public static object methodNull()
        {
            return new { code = METHOD_NULL, message = "method null" };
        }

    }
}